﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DeStores.Common.DAL.Abstract;
using NHibernate;

namespace DeStores.Common.DAL.Manager
{
    public class RepositoryManager : IRepositoryManager
    {
        #region Fields

        private readonly ISessionFactory _sessionFactory;

        #endregion

        #region Constructors

        public RepositoryManager(ISessionFactory sessionFactory)
        {
            
            _sessionFactory = sessionFactory;
        }

        #endregion

        #region IRepositoryManager

        public  IRepository Create()
        {
            return new Repository(_sessionFactory.OpenSession());
        }

        #endregion
    }
}
